<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- 
    JSP Name : notice_list.jsp
    Description : 뉴스/공지 리스트
    author hiyaci
    since 2012. 7. 20.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 7. 20.     hiyaci     최초 생성
--%>

<%@ include file="/WEB-INF/jsp/com/include/declare.jspf" %>
<%@ include file="/WEB-INF/jsp/com/include/doctype.jspf" %>
<script>
<!--
$(document).ready(function(){
    var form = document.searchForm;
    $("#searchScn1").change(function () {
        $("#pageIndex").val("1");
        $("#searchScn").val($('input:radio[name:searchScn]:checked').val());
        form.action = "<c:url value='/news/selectNewsPaging.do'/>";
        form.submit(); 
    }); 
     
    $("#searchScn2").change(function () {
        $("#pageIndex").val("1");
        $("#searchScn").val($('input:radio[name:searchScn]:checked').val());
        form.action = "<c:url value='/news/selectNewsPaging.do'/>";
        form.submit();
    });
    $("#searchScn3").change(function () {
        $("#pageIndex").val("1");
        $("#searchScn").val($('input:radio[name:searchScn]:checked').val());
        form.action = "<c:url value='/news/selectNewsPaging.do'/>";
        form.submit(); 
    }); 
    $("#pageIndex").val("${newsSearchVO.pageIndex }"); 
}); 

function fncView(str) {
    var form = document.searchForm;
    $("#blcSn").val(str);
    $("#pageIndex").val("1");
    form.action = "<c:url value='/news/selectNewsDetail.do'/>";
    form.submit();
} 

function fnLinkPage(pageIndex) {
    
    $("#pageIndex").val(pageIndex);
    var form = document.searchForm;
    form.action = "<c:url value='/news/selectNewsPaging.do'/>";
    form.submit();
} 

//-->
</script>
</head>
<body>
<%@ include file="/WEB-INF/jsp/com/include/layerpopup.jspf" %>
<div id="wrap" class="non-subnavigation">
	<%@ include file="/WEB-INF/jsp/com/include/navi_utill_sub.jspf" %>
	<%@ include file="/WEB-INF/jsp/com/include/navi_header.jspf" %>
	<hr />

	<%@ include file="/WEB-INF/jsp/com/include/sub_header_notice.jspf" %>
	<hr />

	<div id="container">
		<div id="subtitle-area"><div class="subtitle-area-inner">
			<%@ include file="/WEB-INF/jsp/com/include/location.jspf" %>
		</div></div>
		<div id="article">
            <form method="get" name="searchForm" id="searchForm">
            <input type="hidden" name="blcSn" id="blcSn"/>
            <input type="hidden" name="pageIndex" id="pageIndex" vlaue="${newsSearchVO.pageIndex }"/>
			<div class="notice-sort-field">
				<p class="legend"><img src="/kr/images/notice/txt_notice_list01.gif" alt="제품뉴스 / 공지사항 보기" /></p>
				<div class="form">
				<!-- cidow_130409 -->
					<label for="searchScn1"><input type="radio" name="searchScn" id="searchScn1" value="ALL" class="check" <c:if test="${newsSearchVO.searchScn ne 'NE' && newsSearchVO.searchScn ne 'NO'}"> checked </c:if> /> 전체보기</label>
					<label for="searchScn2"><input type="radio" name="searchScn" id="searchScn2" value="NE" class="check space" <c:if test="${newsSearchVO.searchScn eq 'NE'}"> checked </c:if>/> 제품뉴스</label>
					<label for="searchScn3"><input type="radio" name="searchScn" id="searchScn3" value="NO" class="check space" <c:if test="${newsSearchVO.searchScn eq 'NO'}"> checked </c:if>/> 공지사항</label>
				<!-- cidow_130409 -->
				</div>
			</div>
			<div class="boardlist-wrap subsection">
				<table summary="번호, 제목, 등록일, 조회수">
				<caption>제품뉴스 및 공지사항</caption>
				<colgroup>
					<col width="8%" />
					<col />
					<col width="13%" />
					<col width="10%" />
				</colgroup>
				<thead>
				<tr>
					<th scope="col">번호</th>
					<th scope="col">제목</th>
					<th scope="col">등록일</th>
					<th scope="col">조회수</th>
				</tr>
				</thead>
				<tbody>
                <c:if test="${ paginationInfo.totalRecordCount <= 0 }">
                    <tr>
                        <td colspan="4" align="center">검색된 결과가 없습니다.</td>
                    </tr>
                </c:if>
                <c:set var="rowNum"
                               value="${ paginationInfo.totalRecordCount - (paginationInfo.currentPageNo-1)* paginationInfo.pageSize}" />
                    <c:forEach var="result" items="${ resultList }" varStatus="status">
    				<tr>
    					<td class="num">${rowNum - status.index}</td>
    					<td><a href="javascript:fncView(${result.blcSn})">
                            <c:if test="${result.scn eq 'NO'}">[공지]</c:if>
                            <c:if test="${result.scn eq 'NE'}">[뉴스]</c:if> 
                            <c:out value="${result.titl}"/></a></td>
    					<td class="center"><fmt:formatDate value="${result.rgstDtm}" pattern="yyyy-MM-dd" /></td>
    					<td class="center"><fmt:formatNumber value="${result.iqOft}" type="number"/></td>
    				</tr>
                    </c:forEach>
                </tbody>
				</table>
			</div>

            <c:if test="${ paginationInfo.totalRecordCount > 0 }">
                <div class="paging">
                    <able:pagination paginationInfo="${paginationInfo}" type="image" jsFunction="fnLinkPage" />
                </div>
            </c:if>
            
			<div class="list-search-form02 subsection">
				<select class="select select-type2" id="searchCondition" name="searchCondition" style="width:230px;">
					<option value="0" <c:if test="${newsSearchVO.searchCondition eq '0'}"> selected </c:if>>전체</option>
                    <option value="1" <c:if test="${newsSearchVO.searchCondition eq '1'}"> selected </c:if>>제목</option>
                    <option value="2" <c:if test="${newsSearchVO.searchCondition eq '2'}"> selected </c:if>>내용</option>
				</select>
				<input type="text" id="searchKeyword" name="searchKeyword" class="txt" style="width:226px" value="${newsSearchVO.searchKeyword}"/>
				<input type="image" src="/kr/images/common/button/btn_search03.gif" alt="SEARCH" />
			</div>
            </form>
		</div>
	</div>
	<hr />
	<%@ include file="/WEB-INF/jsp/com/include/footer.jspf" %>